package persistent.prestige.module.ums.action;

import java.util.HashMap;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import persistent.prestige.module.ums.model.UmsUser;
import persistent.prestige.module.ums.service.UmsUserService;

/**
 * @Title: 
 * @Package persistent.prestige.modules.ums.action
 * @Description: 
 * @author dingw prestigeding@126.com
 * @date 2015年7月15日 下午2:28:49
 * @version V1.0
 */
@Controller
@RequestMapping("/ums")
public class UmsController {
	
	@Autowired
	private UmsUserService umsUserService;
	
	
	@RequestMapping("/test")
	@ResponseBody
	public Map test() {
		Map result = new HashMap();
		try {
			UmsUser user = umsUserService.findById(1);
			if(user == null ) {
				result.put("errMsg", "没有找到用户信息");
			} else {
				result.put("errMsg", "用户登陆名:" + user.getUserName());
			}
		} catch (Exception e) {
			// TODO: handle exception
			e.printStackTrace();
			result.put("errMsg", "系统运行异常");
		}
		
		
		return result;
	}

}
